package com.chixing.work_04;

public class Test {
    public static void main(String[] args) {
        Pet p1 = new Dog();
        System.out.println(p1 instanceof Dog);
        System.out.println(p1 instanceof Pet);
        p1.run();
        Dog d1 = (Dog)p1;
        System.out.println(d1 instanceof Dog);
        System.out.println(d1 instanceof Pet);
        d1.run();
        Pet p2 = new Pet();
//        Dog d2 = (Dog)p2;
//        System.out.println(d2 instanceof Dog);
//        System.out.println(d2 instanceof Pet);

    }
}
